package com.ylc.chat.util;

import com.ylc.chat.entity.User;

import java.util.List;

/**
 * @Author: ylc
 * @Description:提供数据类型转换方法
 */
public class TransfromUtil {
    /**
     * 将List<User>转为String[],用于传入JPane
     * @param list
     * @return
     */
    public static String[] formatStringArr(List<User> list){
        String[] res = new String[list.size()];
        for(int i = 0; i < list.size(); i++){
            res[i] = list.get(i).getUname();
        }
        return res;
    }
}
